package ph.loong.deliveryman.view.progress;


import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.widget.TextView;

import deliveryman.loong.ph.deliveryman.R;


/**
 * Author jc.lu
 * Dates 2018/2/8.
 * Email Tbsupland@163.com
 */
public class DialogWaitting {
	
	public Dialog mDialog = null;
	private TextView mTextView = null;
	
	public DialogWaitting(Context context) {
		mDialog = new Dialog(context, R.style.MyLoadingDialogStyle);
		mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		mDialog.setContentView(R.layout.dialog_waiting);
		mTextView = (TextView)mDialog.findViewById(R.id.waittingText);
		
		Window window = mDialog.getWindow(); 
        window.setWindowAnimations(R.style.dialog_fullscreen);
//		mDialog.setCancelable(false); // 是否可以按“返回键”消失
	}
	
	
	public void show() {
 		mDialog.show();
	}
	
	public void show(String hint) {
		mTextView.setText(hint);
		mDialog.show();
	}
	
	public void show(int hint) {
		mTextView.setText(hint);
		mDialog.show();
	}
	
	public void dismiss() {
		mDialog.dismiss();
	}

}
